<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>角色添加</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
		$(document).ready(function() {
			$("#no").focus();
			$("#inputForm").validate({
				rules: {
					loginName: {remote: "${ctx}/sys/user/checkLoginName?oldLoginName=" + encodeURIComponent('${user.loginName}')}
				},
				messages: {
					loginName: {remote: "用户登录名已存在"},
					confirmNewPassword: {equalTo: "输入与上面相同的密码"}
				},
				submitHandler: function(form){
					loading('正在提交，请稍等...');
					form.submit();
				},
				errorContainer: "#messageBox",
				errorPlacement: function(error, element) {
					$("#messageBox").text("输入有误，请先更正。");
					if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
						error.appendTo(element.parent().parent());
					} else {
						error.insertAfter(element);
					}
				}
			});
		});
	</script>
</head>
<body>
	<ul class="nav nav-tabs">
		<li><a href="${ctx}/book/roler/list">角色列表</a></li>
		<li class="active"><a href="${ctx}/book/roler/form?id=${readerRoler.rdRoleId}">角色${not empty readerRoler.rdRoleId?'修改':'添加'}</a></li>
	</ul><br/>
	<form:form id="inputForm" modelAttribute="readerRoler" action="${ctx}/book/roler/save" method="post" class="form-horizontal">
		<form:hidden path="id"/>
		<sys:message content="${message}"/>

		<div class="control-group">
			<label class="control-label">角色编号:</label>
			<div class="controls">
				<form:input path="rdRoleId" htmlEscape="false" maxlength="50"  readonly="true"  placeholder="系统自动生成"/>
			</div>
		</div>

		<div class="control-group">
			<label class="control-label">角色名称:</label>
			<div class="controls">
				<form:input path="roleName" htmlEscape="false" maxlength="50" class="required"/>
			</div>
		</div>


		<div class="control-group">
			<label class="control-label">角色身份:</label>
			<div class="controls">
				<form:select path="role" class="input-medium">
					<form:options items="${fns:getDictList('rolertype')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
				</form:select>
			</div>
		</div>

		<div class="control-group">
			<label class="control-label">可借天数:</label>
			<div class="controls">
				<form:input path="rdCanBorrowDays" htmlEscape="false" maxlength="50" class="required digits"/>
			</div>
		</div>


		<div class="control-group">
			<label class="control-label">可借册数:</label>
			<div class="controls">
				<form:input path="rdCanBorrowdBooks" htmlEscape="false" maxlength="50" class="required digits"/>
			</div>
		</div>

		<div class="control-group">
			<label class="control-label">可续借次数:</label>
			<div class="controls">
				<form:input path="rdContinueBorrowCount" htmlEscape="false" maxlength="50" class="required digits"/>
			</div>
		</div>

		<div class="control-group">
			<label class="control-label">可续借天数:</label>
			<div class="controls">
				<form:input path="rdContinueBorrowDays" htmlEscape="false" maxlength="50" class="required digits"/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">最短还书间隔（天）:</label>
			<div class="controls">
				<form:input path="minRetdays" htmlEscape="false" maxlength="10" class="required digits"/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">可借书库:</label>
			<div class="controls">
				<form:checkboxes path="bkPlaceIdList" items="${allPlaces}" itemLabel="gcdName" itemValue="placeid" htmlEscape="false" class="required"/>
				<span class="help-inline"><font color="red">*</font> </span>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">备注信息:</label>
			<div class="controls">
				<form:textarea path="remarks" htmlEscape="false" rows="3" maxlength="200" class="input-xlarge"/>
			</div>
		</div>

		<div class="form-actions">
			<input id="btnSubmit" class="btn btn-primary" type="submit" value="保 存"/>&nbsp;
			<input id="btnCancel" class="btn" type="button" value="返 回" onclick="history.go(-1)"/>
		</div>

	</form:form>
</body>
</html>